<?php

class SearchFirmsForm extends CFormModel {

	public $text;
    
	public $rubric;
	public $category;
	public $country;
	public $region;
    
	public $city;
    public $address;
	public $zip;
	public $phone;
    
	public function rules() {
		return array(
			array('city, country, region, rubric, category, zip', 'numerical', 'integerOnly'=>true),
			array('text', 'length', 'max'=>100),
			array('phone', 'length', 'max'=>25),
			array('zip', 'length', 'max'=>6),
			array('rubric, category, text, country, city, region, address, zip, phone', 'default', 'setOnEmpty' => true, 'value' => null),
			array('rubric, category, text, country, city, region, address, zip, phone', 'safe', 'on'=>'search'),
		);
	}
    
	public function attributeLabels() {
		return array(
			'rubric' => Yii::t('app', 'Рубрика'),
			'category' => Yii::t('app', 'Категория'),
			'text' => Yii::t('app', 'Текст'),
			'country' => Yii::t('app', 'Страна'),
			'city' => Yii::t('app', 'Город'),
			'region' => Yii::t('app', 'Регион'),
			'address' => Yii::t('app', 'Адрес'),
			'zip' => Yii::t('app', 'Индекс'),
			'phone' => Yii::t('app', 'Телефон'),
		);
	}    

}
